package com.kefu.robot.vo;

import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractInsertVo;
import com.kefu.robot.model.RobotAidataInfo;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author xiaoyu
 * @date 2023/11/03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "AI模型信息")
public class RobotAidataInfoInsertVo extends AbstractInsertVo<RobotAidataInfo> {

    @ApiModelProperty(value = "名称", required = true)
    private String aidataName;
    @ApiModelProperty(value = "状态 0：未启用 1：启用", required = true)
    private Integer state;
    @ApiModelProperty(value = "备注")
    private String remark;

    @Override
    public RobotAidataInfo convert() {
        RobotAidataInfo info = BeanUtil.toBean(this, RobotAidataInfo.class);
        KefuContext context = KefuContext.getKefuContext();
        info.setCreateUser(context.getUserId());
        info.setCreateTime(context.getNow());
        info.setTenantId(context.getTenantId());
        info.setUpdateUser(context.getUserId());
        info.setUpdateTime(context.getNow());
        return info;
    }
}